package com.yinp.proapp.module.baidu_map.adapter;

import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.yinp.proapp.adapter.SingleViewHolder;
import com.yinp.proapp.databinding.ItemBaiduMapSearchBinding;
import com.yinp.proapp.module.baidu_map.bean.BaiduMapSearchBean;

import java.util.List;

/**
 * @author :yinpeng
 * date      :2021/10/8
 * package   :com.yinp.proapp.module.baidu_map.adapter
 * describe  :
 */
public class BaiduMapSearchAdapter extends RecyclerView.Adapter<SingleViewHolder> {
    private List<BaiduMapSearchBean> list;

    public BaiduMapSearchAdapter(List<BaiduMapSearchBean> list) {
        this.list = list;
    }

    @NonNull
    @Override
    public SingleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        ItemBaiduMapSearchBinding binding = ItemBaiduMapSearchBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false);
        SingleViewHolder viewHolder = new SingleViewHolder(binding);
        binding.tvPath.setOnClickListener(v -> {

        });
        binding.llAddress.setOnClickListener(v -> {

        });
        return viewHolder;
    }

    @Override
    public void onBindViewHolder(@NonNull SingleViewHolder holder, int position) {
        BaiduMapSearchBean bean = list.get(position);
    }

    @Override
    public int getItemCount() {
        return list.size();
    }
}
